import { request } from "@/utils/http"
import { getHosListDetailReturnType, getHosListParamsType,getHosListProvinceReturn,getHosListReturnType } from "./model/hospitalListType"

//获取医院分页请求
export const getHosListPageRequest = (page:number,limit:number,data:getHosListParamsType) => {
    return request.get<any,getHosListReturnType>(`/admin/hosp/hospital/${page}/${limit}`,{
        params:data
    })
}

//获取省份
export const getHosListProvinceRequest = () => {
    return request.get<any,getHosListProvinceReturn>('/admin/cmn/dict/findByDictCode/province')
}

//获取市或区
export const getHosCityOrdistrictRequest = (parentId:string) => {
    return request.get<any,getHosListProvinceReturn>(`/admin/cmn/dict/findByParentId/${parentId}`)
}

//获取医院详情
export const getHosListDetailRequest = (id:string) => {
    return request.get<any,getHosListDetailReturnType>(`/admin/hosp/hospital/show/${id}`)
}

//更新状态
export const updateStatusRequest = (id:string,status:0|1) => {
    return request.get<any,null>(`/admin/hosp/hospital/updateStatus/${id}/${status}`)
}